import axios from 'axios'

function axiosGet(url, params) {
	const basUrl = '/api' + url
	return new Promise(function(resolve, reject) {
		axios.get(basUrl, params)
			.then(function(res) {
				resolve(res)
			})
			.catch(function(err) {
				reject(err)
			})
	})
}

function axiosPost(url, params) {
	const basUrl = '/api' + url
	return new Promise(function(resolve, reject) {
		axios.post(basUrl, params)
			.then(function(res) {
				resolve(res)
			})
			.catch(function(err) {
				reject(err)
			})
	})
}
export {
	axiosGet,
	axiosPost
}
